Cubic Spline
   HOME

TheInfoList



OR:

In
numerical analysis Numerical analysis is the study of algorithms that use numerical approximation (as opposed to symbolic manipulations) for the problems of mathematical analysis (as distinguished from discrete mathematics). It is the study of numerical methods ...
, a cubic Hermite spline or cubic Hermite interpolator is a spline where each piece is a third-degree
polynomial In mathematics, a polynomial is an expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication, and positive-integer powers of variables. An exampl ...
specified in Hermite form, that is, by its values and first derivatives at the end points of the corresponding
domain Domain may refer to: Mathematics *Domain of a function, the set of input values for which the (total) function is defined ** Domain of definition of a partial function ** Natural domain of a partial function **Domain of holomorphy of a function * ...
interval. Cubic Hermite splines are typically used for
interpolation In the mathematical field of numerical analysis, interpolation is a type of estimation, a method of constructing (finding) new data points based on the range of a discrete set of known data points. In engineering and science, one often has ...
of numeric data specified at given argument values x_1,x_2,\ldots,x_n, to obtain a
continuous function In mathematics, a continuous function is a function such that a continuous variation (that is a change without jump) of the argument induces a continuous variation of the value of the function. This means that there are no abrupt changes in val ...
. The data should consist of the desired function value and derivative at each x_k. (If only the values are provided, the derivatives must be estimated from them.) The Hermite formula is applied to each interval (x_k, x_) separately. The resulting spline will be continuous and will have continuous first derivative. Cubic polynomial splines can be specified in other ways, the Bezier cubic being the most common. However, these two methods provide the same set of splines, and data can be easily converted between the Bézier and Hermite forms; so the names are often used as if they were synonymous. Cubic polynomial splines are extensively used in
computer graphics Computer graphics deals with generating images with the aid of computers. Today, computer graphics is a core technology in digital photography, film, video games, cell phone and computer displays, and many specialized applications. A great de ...
and
geometric modeling __NOTOC__ Geometric modeling is a branch of applied mathematics and computational geometry that studies methods and algorithms for the mathematical description of shapes. The shapes studied in geometric modeling are mostly two- or three-dimensio ...
to obtain
curve In mathematics, a curve (also called a curved line in older texts) is an object similar to a line, but that does not have to be straight. Intuitively, a curve may be thought of as the trace left by a moving point. This is the definition that ...
s or motion
trajectories A trajectory or flight path is the path that an object with mass in motion follows through space as a function of time. In classical mechanics, a trajectory is defined by Hamiltonian mechanics via canonical coordinates; hence, a complete traj ...
that pass through specified points of the plane or three-dimensional
space Space is the boundless three-dimensional extent in which objects and events have relative position and direction. In classical physics, physical space is often conceived in three linear dimensions, although modern physicists usually consi ...
. In these applications, each coordinate of the plane or space is separately interpolated by a cubic spline function of a separate parameter ''t''. Cubic polynomial splines are also used extensively in structural analysis applications, such as
Euler–Bernoulli beam theory Euler–Bernoulli beam theory (also known as engineer's beam theory or classical beam theory) is a simplification of the linear theory of elasticity which provides a means of calculating the load-carrying and deflection characteristics of beams ...
. Cubic splines can be extended to functions of two or more parameters, in several ways. Bicubic splines (
Bicubic interpolation In mathematics, bicubic interpolation is an extension of cubic interpolation (not to be confused with cubic spline interpolation, a method of applying cubic interpolation to a data set) for interpolating data points on a two-dimensional regula ...
) are often used to interpolate data on a regular rectangular grid, such as
pixel In digital imaging, a pixel (abbreviated px), pel, or picture element is the smallest addressable element in a raster image, or the smallest point in an all points addressable display device. In most digital display devices, pixels are the ...
values in a
digital image A digital image is an image composed of picture elements, also known as ''pixels'', each with '' finite'', '' discrete quantities'' of numeric representation for its intensity or gray level that is an output from its two-dimensional functions ...
or
altitude Altitude or height (also sometimes known as depth) is a distance measurement, usually in the vertical or "up" direction, between a reference datum and a point or object. The exact definition and reference datum varies according to the context ...
data on a terrain. Bicubic surface patches, defined by three bicubic splines, are an essential tool in computer graphics. Cubic splines are often called csplines, especially in computer graphics. Hermite splines are named after
Charles Hermite Charles Hermite () FRS FRSE MIAS (24 December 1822 – 14 January 1901) was a French mathematician who did research concerning number theory, quadratic forms, invariant theory, orthogonal polynomials, elliptic functions, and algebra. ...
.


Interpolation on a single interval


Unit interval , 1/h2>

On the unit interval ,1/math>, given a starting point \boldsymbol_0 at t = 0 and an ending point \boldsymbol_1 at t = 1 with starting tangent \boldsymbol_0 at t = 0 and ending tangent \boldsymbol_1 at t = 1, the polynomial can be defined by \boldsymbol(t) = \left(2t^3 - 3t^2 + 1\right) \boldsymbol_0 + \left(t^3 - 2t^2 + t\right) \boldsymbol_0 + \left(-2t^3 + 3t^2\right) \boldsymbol_1 + \left(t^3 - t^2\right) \boldsymbol_1, where ''t'' ∈ , 1


Interpolation on an arbitrary interval

Interpolating x in an arbitrary interval (x_k, x_) is done by mapping the latter to , 1/math> through an affine (degree-1) change of variable. The formula is \boldsymbol(x) = h_(t) \boldsymbol_k + h_(t) (x_ - x_k)\boldsymbol_k + h_(t) \boldsymbol_ + h_(t)(x_ - x_k)\boldsymbol_, where t = (x - x_k)/(x_ - x_k), and h refers to the basis functions, defined
below Below may refer to: *Earth * Ground (disambiguation) *Soil *Floor * Bottom (disambiguation) *Less than *Temperatures below freezing *Hell or underworld People with the surname *Ernst von Below (1863–1955), German World War I general *Fred Below ...
. Note that the tangent values have been scaled by x_ - x_k compared to the equation on the unit interval.


Uniqueness

The formula specified above provides the unique third-degree polynomial path between the two points with the given tangents. Proof. Let P, Q be two third-degree polynomials satisfying the given boundary conditions. Define R = Q - P, then: : R(0) = Q(0)-P(0) = 0, : R(1) = Q(1) - P(1) = 0. Since both Q and P are third-degree polynomials, R is at most a third-degree polynomial. So R must be of the form R(x) = ax(x - 1)(x - r). Calculating the derivative gives R'(x) = ax(x - 1) + ax(x - r) + a(x - 1)(x - r). We know furthermore that : R'(0) = Q'(0) - P'(0) = 0, : R'(1) = Q'(1) - P'(1) = 0, Putting () and () together, we deduce that a = 0, and therefore R = 0, thus P = Q.


Representations

We can write the interpolation polynomial as \boldsymbol(t) = h_(t)\boldsymbol_0 + h_(t)(x_-x_k)\boldsymbol_0 + h_(t)\boldsymbol_1 + h_(t)(x_-x_k)\boldsymbol_1 where h_, h_, h_, h_ are Hermite basis functions. These can be written in different ways, each way revealing different properties: The "expanded" column shows the representation used in the definition above. The "factorized" column shows immediately that h_ and h_ are zero at the boundaries. You can further conclude that h_ and h_ have a zero of multiplicity 2 at 0, and h_ and h_ have such a zero at 1, thus they have slope 0 at those boundaries. The "Bernstein" column shows the decomposition of the Hermite basis functions into Bernstein polynomials of order 3: B_k(t) = \binom \cdot t^k \cdot (1 - t)^. Using this connection you can express cubic Hermite interpolation in terms of cubic
Bézier curve A Bézier curve ( ) is a parametric curve used in computer graphics and related fields. A set of discrete "control points" defines a smooth, continuous curve by means of a formula. Usually the curve is intended to approximate a real-world shape ...
s with respect to the four values \boldsymbol_0, \boldsymbol_0 + \frac \boldsymbol_0, \boldsymbol_1 - \frac \boldsymbol_1, \boldsymbol_1 and do Hermite interpolation using the de Casteljau algorithm. It shows that in a cubic Bézier patch the two control points in the middle determine the tangents of the interpolation curve at the respective outer points. We can also write the polynomial in standard form as \boldsymbol(t) = \left(2\boldsymbol_0 + \boldsymbol_0 - 2\boldsymbol_1 + \boldsymbol_1\right) t^3 + \left(-3\boldsymbol_0 + 3\boldsymbol_1 - 2\boldsymbol_0 - \boldsymbol_1\right) t^2 + \boldsymbol_0 t + \boldsymbol_0 where the control points and tangents are coefficients. This permits efficient evaluation of the polynomial at various values of ''t'' since the constant coefficients can be computed once and reused.


Interpolating a data set

A data set, (x_k,\boldsymbol_k) for k=1,\ldots,n, can be interpolated by applying the above procedure on each interval, where the tangents are chosen in a sensible manner, meaning that the tangents for intervals sharing endpoints are equal. The interpolated curve then consists of piecewise cubic Hermite splines and is globally continuously differentiable in (x_1, x_n). The choice of tangents is not unique, and there are several options available.


Finite difference

The simplest choice is the three-point difference, not requiring constant interval lengths: : \boldsymbol_k = \frac \left(\frac + \frac\right) for internal points k = 2, \dots, n - 1, and one-sided difference at the endpoints of the data set.


Cardinal spline

A cardinal spline, sometimes called a canonical spline, is obtained if : \boldsymbol_k = (1 - c) \frac is used to calculate the tangents. The parameter is a ''tension'' parameter that must be in the interval . In some sense, this can be interpreted as the "length" of the tangent. Choosing yields all zero tangents, and choosing yields a Catmull–Rom spline.


Catmull–Rom spline

For tangents chosen to be : \boldsymbol_k = \frac \frac a Catmull–Rom spline is obtained, being a special case of a cardinal spline. This assumes uniform parameter spacing. The curve is named after
Edwin Catmull Edwin Earl "Ed" Catmull (born March 31, 1945) is an American computer scientist who is the co-founder of Pixar and was the President of Walt Disney Animation Studios. He has been honored for his contributions to 3D computer graphics, including th ...
and
Raphael Rom Raphael "Raphi" Rom is an Israeli computer scientist working at Technion – Israel Institute of Technology. Rom earned his Ph.D. in 1975 from the University of Utah, under the supervision of Thomas Stockham Thomas Greenway Stockham (December 22 ...
. The principal advantage of this technique is that the points along the original set of points also make up the control points for the spline curve. Two additional points are required on either end of the curve. The uniform Catmull–Rom implementation can produce loops and self-intersections. The chordal and centripetal Catmull–Rom implementations solve this problem, but use a slightly different calculation. In
computer graphics Computer graphics deals with generating images with the aid of computers. Today, computer graphics is a core technology in digital photography, film, video games, cell phone and computer displays, and many specialized applications. A great de ...
, Catmull–Rom splines are frequently used to get smooth interpolated motion between
key frame In animation and filmmaking, a key frame (or keyframe) is a drawing or shot that defines the starting and ending points of a smooth transition. These are called ''frames'' because their position in time is measured in frames on a strip of fi ...
s. For example, most camera path animations generated from discrete key-frames are handled using Catmull–Rom splines. They are popular mainly for being relatively easy to compute, guaranteeing that each key frame position will be hit exactly, and also guaranteeing that the tangents of the generated curve are continuous over multiple segments.


Kochanek–Bartels spline

A Kochanek–Bartels spline is a further generalization on how to choose the tangents given the data points \boldsymbol_, \boldsymbol_k and \boldsymbol_, with three parameters possible: tension, bias and a continuity parameter.


Monotone cubic interpolation

If a cubic Hermite spline of any of the above listed types is used for
interpolation In the mathematical field of numerical analysis, interpolation is a type of estimation, a method of constructing (finding) new data points based on the range of a discrete set of known data points. In engineering and science, one often has ...
of a
monotonic In mathematics, a monotonic function (or monotone function) is a function between ordered sets that preserves or reverses the given order. This concept first arose in calculus, and was later generalized to the more abstract setting of order ...
data set, the interpolated function will not necessarily be monotonic, but monotonicity can be preserved by adjusting the tangents.


Interpolation on the unit interval with matched derivatives at endpoints

Consider a single coordinate of the points \boldsymbol_, \boldsymbol_n, \boldsymbol_ and \boldsymbol_ as the values that a function ''f''(''x'') takes at integer ordinates ''x'' = ''n'' − 1, ''n'', ''n'' + 1 and ''n'' + 2, : p_n = f(n) \quad \forall n \in \mathbb. In addition, assume that the tangents at the endpoints are defined as the centered differences of the adjacent points: m_n = \frac = \frac \quad \forall n \in \mathbb. To evaluate the interpolated ''f''(''x'') for a real ''x'', first separate ''x'' into the integer portion ''n'' and fractional portion ''u'': : x = n + u, : n = \lfloor x \rfloor = \operatorname(x), : u = x - n = x - \lfloor x \rfloor, : 0 \le u < 1, where \lfloor x \rfloor denotes the
floor function In mathematics and computer science, the floor function is the function that takes as input a real number , and gives as output the greatest integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least int ...
, which returns the largest integer no larger than ''x''. Then the Catmull–Rom spline isTwo hierarchies of spline interpolations. Practical algorithms for multivariate higher order splines
\begin f(x) = f(n + u) &= \text_u(p_, p_n, p_, p_) \\ &= \begin 1 & u & u^2 & u^3 \end \begin 0 & 1 & 0 & 0 \\ -\tfrac12 & 0 & \tfrac12 & 0 \\ 1 & -\tfrac52 & 2 & -\tfrac12 \\ -\tfrac12 & \tfrac32 & -\tfrac32 & \tfrac12 \end \begin p_ \\ p_n \\ p_ \\ p_ \end \\ &= \frac 12 \begin -u^3 +2u^2 - u \\ 3u^3 - 5u^2 + 2 \\ -3u^3 + 4u^2 + u \\ u^3 - u^2 \end^\mathrm \begin p_ \\ p_n \\ p_ \\ p_ \end \\ &= \frac 12 \begin u\big((2 - u)u - 1\big) \\ u^2(3u - 5) + 2 \\ u\big((4 - 3u)u + 1\big) \\ u^2(u - 1) \end^\mathrm \begin p_ \\ p_n \\ p_ \\ p_ \end \\ &= \tfrac12 \Big(\big(u^2(2 - u) - u\big) p_ + \big(u^2(3u - 5) + 2\big) p_n + \big(u^2(4 - 3u) + u\big) p_ + u^2(u - 1) p_\Big) \\ &= \tfrac12 \big((-u^3 + 2u^2 - u) p_ + (3u^3 - 5u^2 + 2) p_n + (-3u^3 + 4u^2 + u) p_ + (u^3 - u^2) p_\big) \\ &= \tfrac12 \big((-p_ + 3p_n - 3p_ + p_) u^3 + (2p_ - 5p_n + 4p_ - p_)u^2 + (-p_ + p_) u + 2p_n\big) \\ &= \tfrac12 \Big(\big((-p_ + 3p_n - 3p_ + p_) u + (2p_ - 5p_n + 4p_ - p_)\big)u + (-p_ + p_)\Big)u + p_n, \end where \mathrm denotes the
matrix transpose In linear algebra, the transpose of a matrix is an operator which flips a matrix over its diagonal; that is, it switches the row and column indices of the matrix by producing another matrix, often denoted by (among other notations). The tr ...
. The bottom equality is depicting the application of Horner's method. This writing is relevant for
tricubic interpolation In the mathematical subfield numerical analysis, tricubic interpolation is a method for obtaining values at arbitrary points in 3D space of a function defined on a regular grid. The approach involves approximating the function locally by an exp ...
, where one optimization requires computing CINT''u'' sixteen times with the same ''u'' and different ''p''.


See also

*
Bicubic interpolation In mathematics, bicubic interpolation is an extension of cubic interpolation (not to be confused with cubic spline interpolation, a method of applying cubic interpolation to a data set) for interpolating data points on a two-dimensional regula ...
, a generalization to two dimensions *
Tricubic interpolation In the mathematical subfield numerical analysis, tricubic interpolation is a method for obtaining values at arbitrary points in 3D space of a function defined on a regular grid. The approach involves approximating the function locally by an exp ...
, a generalization to three dimensions *
Hermite interpolation In numerical analysis, Hermite interpolation, named after Charles Hermite, is a method of polynomial interpolation, which generalizes Lagrange interpolation. Lagrange interpolation allows computing a polynomial of degree less than that takes the ...
* Multivariate interpolation * Spline interpolation *
Discrete spline interpolation In the mathematical field of numerical analysis, discrete spline interpolation is a form of interpolation where the interpolant is a special type of piecewise polynomial called a discrete spline. A discrete spline is a piecewise polynomial such tha ...


References


External links


Spline Curves
Prof. Donald H. House
Clemson University Clemson University () is a public land-grant research university in Clemson, South Carolina. Founded in 1889, Clemson is the second-largest university in the student population in South Carolina. For the fall 2019 semester, the university enr ...

Multi-dimensional Hermite Interpolation and Approximation
Prof. Chandrajit Bajaj,
Purdue University Purdue University is a public land-grant research university in West Lafayette, Indiana, and the flagship campus of the Purdue University system. The university was founded in 1869 after Lafayette businessman John Purdue donated land and ...

Introduction to Catmull–Rom Splines
MVPs.org


Interpolation methods: linear, cosine, cubic and hermite (with C sources)

Common Spline Equations
{{DEFAULTSORT:Cubic Hermite Spline Splines (mathematics) Interpolation